

import UIKit


extension UIView{

    @IBInspectable var borderWidth:CGFloat{
        get{
            return layer.borderWidth
        }

        set{

            if newValue < 0{

                layer.borderWidth = 1
                
                return;
            }

            layer.borderWidth = newValue
        }
    }

    @IBInspectable var borderColor:UIColor{
        get{
            return UIColor(CGColor: layer.borderColor!)
        }

        set{
            layer.borderColor = newValue.CGColor
        }
    }

    @IBInspectable var cornerRadius:CGFloat{
        
        get{
            return layer.cornerRadius
        }

        set{

            if newValue > 0{
                layer.masksToBounds = true
            }
            layer.cornerRadius = newValue
        }
    }



}



